home *** CD-ROM | disk | FTP | other *** search
- ;void write_vertical_b(strg,col,row,color);
- ; unsigned char *strg,col,row,color;
-
- EXTRN _memory_model:byte
- EXTRN _video_page:byte
-
- _TEXT SEGMENT BYTE PUBLIC 'CODE'
- ASSUME CS:_TEXT
- PUBLIC _write_vertical_b
- _write_vertical_b proc near
- push bp ;
- mov bp,sp ;set stack frame
- push si ;
- cmp _memory_model,0 ;near or far?
- jle begin ;jump if near
- inc bp ;else add 2 to BP
- inc bp ;
- begin: push ds ;save DS too
- mov bh,_video_page ;pagenum to BH
- cmp _memory_model,2 ;data near or far?
- jb L0 ;jump if near
- lds si,dword ptr[bp+4] ;DS:SI pts to Strg
- inc bp ;add 2 to BP since dword ptr
- inc bp ;
- jmp short L00 ;
- L0: mov si,[bp+4] ;near case
- L00: mov bl,[bp+10] ;attribute in BL
- mov dh,[bp+8] ;row in DH
- dec dh ;count from 0
- mov dl,[bp+6] ;col in DL
- dec dl ;count from 0
- sub ax,ax ;clear AX
- cmp byte ptr[si],0 ;test for null stinrg
- je L2 ;
- mov cx,1 ;write 1 char each time
- L1: mov ah,2 ;function to set cursor
- int 10h ;set the cursor
- mov ah,9 ;function to write char
- mov al,[si] ;move char to al
- inc si ;inc string pointer for next time
- cmp al,0 ;test for end of string
- je L2 ;
- int 10h ;write char & attribute
- inc dh ;forward row position
- jmp short L1 ;loop
- L2: pop ds ;
- pop si ;
- pop bp ;
- cmp _memory_model,0 ;quit
- jle quit ;
- db 0CBh ;RET far
- quit: ret ;RET near
- _write_vertical_b endp
- _TEXT ENDS
- END